fastcs_secop
SECoP support using FastCS.
Submodules
- class fastcs_secop.SecopCommandController(*, connection: IPConnection, module_name: str, command_name: str, datainfo: dict[str, Any], quirks: SecopQuirks)[source]
Bases:
ControllerSubcontroller for a SECoP command.
This class is automatically added as a subcontroller by
SecopModuleControllerfor command-type parameters.- Parameters:
connection – The connection to use.
module_name – The module in which this command is defined.
command_name – The name of the command.
datainfo – The datainfo dictionary for this command.
quirks – The quirks configuration (see
SecopQuirks).
- class fastcs_secop.SecopController(settings: IPConnectionSettings, quirks: SecopQuirks | None = None)[source]
Bases:
ControllerFastCS Controller for a SECoP node.
The intended usage is via
fastcs.control_system.FastCS:from fastcs_secop import SecopController, SecopQuirks from fastcs.control_system import FastCS controller = SecopController( settings=IPConnectionSettings(ip="127.0.0.1", port=1234), quirks=SecopQuirks(...), ) transports = [...] fastcs = FastCS( controller, transports, ) fastcs.run()
See also
Example CA IOC and Example PVA IOC for examples of full configurations
- Parameters:
settings – The communication settings (e.g. IP address, port) at which the SECoP node is reachable.
quirks –
SecopQuirksthat affects how attributes are processed.
- async check_idn() None[source]
Verify that the device is a SECoP device.
This is checked using the SECoP identification message.
- Raises:
SecopError – if the device is not a SECoP device.
- async deactivate() None[source]
Turn off asynchronous SECoP communication.
See activate, deactivate: Control events for details.
- async initialise() None[source]
Set up FastCS for this SECoP node.
This introspects the description of the SECoP device to determine the names and contents of the modules in this SECoP node.
A subcontroller of type
SecopModuleControlleris added for each discovered module.This controller attempts to periodically reconnect to the device if the connection was closed, and disables asynchronous messages on instantiation.
- Raises:
SecopError – if the device is not a SECoP device, if a reply in an unexpected format is received, or the SECoP node’s configuration cannot be handled by
fastcs_secop.
- exception fastcs_secop.SecopError[source]
Bases:
ExceptionError raised to identify a SECoP protocol or configuration problem.
- class fastcs_secop.SecopModuleController(*, connection: IPConnection, module_name: str, module: dict[str, Any], quirks: SecopQuirks)[source]
Bases:
ControllerFastCS controller for a SECoP module.
This class is automatically added as a subcontroller by
SecopControllerfor each present SECoP module.- Parameters:
connection – The connection to use.
module_name – The name of the SECoP module.
module – A deserialised description, in the SECoP over-the-wire format, of this module.
quirks – Affects how attributes are processed. See
SecopQuirksfor details.
- class fastcs_secop.SecopQuirks(update_period: float = 1.0, skip_modules: Collection[str] = <factory>, skip_accessibles: Collection[tuple[str, str]]=<factory>, raw_accessibles: Collection[tuple[str, str]]=<factory>, raw_array: bool = False, raw_matrix: bool = False, raw_tuple: bool = False, raw_struct: bool = False, max_description_length: int | None = None)[source]
Bases:
objectDefine special handling for SECoP modules or accessibles.
Not all combinations of SECoP features can be handled by all transports.
SecopQuirksallows specifying non-default behaviour to work around these limitations.- max_description_length: int | None = None
Truncate accessible descriptions to this length.
This is useful for transports such as EPICS CA which have a maximum description length.
- raw_accessibles: Collection[tuple[str, str]]
Create any listed
(module_name, accessible_name)tuples in raw mode.JSON for the specified accessibles will be treated as strings.
- raw_array: bool = False
If the accessible has an array type, read it in raw mode.
JSON values for any array-type accessible will be treated as strings.
- raw_matrix: bool = False
If the accessible has a matrix type, read it in raw mode.
JSON values for any matrix-type accessible will be treated as strings.
This is useful for transports which cannot represent arbitrary N-dimensional arrays.
- raw_struct: bool = False
If the accessible has a struct type, read it in raw mode.
JSON values for any struct-type accessible will be treated as strings.
This is useful for transports which do not support the FastCS
Tabletype.
- raw_tuple: bool = False
If the accessible has a tuple type, read it in raw mode.
JSON values for any tuple-type accessible will be treated as strings.
This is useful for transports which do not support the FastCS
Tabletype.
- skip_accessibles: Collection[tuple[str, str]]
Skip creating any listed
(module_name, accessible_name)tuples.
- skip_modules: Collection[str]
Skip creating any listed modules.